package org.foj.service.project {
  import mx.collections.ArrayCollection;
  import mx.rpc.AsyncToken;
  import mx.rpc.IResponder;
  import mx.rpc.events.ResultEvent;
  import mx.rpc.http.mxml.HTTPService;
  
  
  public class MockProjectDelegate implements ProjectDelegate {
    
    private var responder:IResponder;
    
    public function MockProjectDelegate(responder:IResponder) {
      this.responder = responder;
    }
    
    public function listProjects():void {      
      var mockService:HTTPService = new HTTPService();
      mockService.url = "/data/projects.xml";
      
      //var call:AsyncToken = mockService.send();
      //call.addResponder(responder);

      
      var projectList:ArrayCollection = new ArrayCollection();
      projectList.addItem("");
      
      projectList.addItem("Flex Bugs");
      projectList.addItem("Time Tracker");
      projectList.addItem("Take over the world");
      
      var resultEvent:ResultEvent = new ResultEvent(ResultEvent.RESULT, false, true, projectList, null, null);
      responder.result(resultEvent);
      
    }

  }
}